package com.bw.ivideo

import android.os.Trace
import com.bw.common.BaseApplication
import com.bw.net.BuildConfig
import com.bw.publish.ui.QiNiuUtils
import com.tencent.bugly.crashreport.CrashReport
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure

/**
 * @author:created by hahajing
 * 时间：2024/4/24 0024
 * 企鹅号:444511958
 * 描述:
 */
class IVideoApplication:BaseApplication() {
    override fun onCreate() {
        super.onCreate()
        Trace.beginSection("SplashActivity InitView")
        //友盟统计sdk的预初始化 弹出 用户隐式协议窗口等待用户同意
        UMConfigure.preInit(this,"6641adf7cac2a664de3307bb","ivideo_channel")

        //Bugly 异常上报 sdk初始化
        CrashReport.initCrashReport(getApplicationContext(), "5bde86546d", BuildConfig.DEBUG)

        //友盟Log开关
        if (BuildConfig.DEBUG){
            UMConfigure.setLogEnabled(true)
        }


        //同意后正式初始化
        UMConfigure.init(this,"6641adf7cac2a664de3307bb","ivideo_channel",UMConfigure.DEVICE_TYPE_PHONE,"")
        //自动采集
        MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO)
        //七牛云短视频sdk初始化
        QiNiuUtils.qiniuInit()
    }

    override fun onTerminate() {
        super.onTerminate()
        MobclickAgent.onKillProcess(this)
    }
}